﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    /// <summary>
    /// 同步缓存
    /// </summary>
    public class SynchronizeCache
    {
        /// <summary>
        /// 版本的检查码
        /// </summary>
        public string VersionsCheckCode { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public long TimeStamp { get; set; }

        /// <summary>
        /// 文件信息列表
        /// </summary>
        public IEnumerable<FileInfo> CacheInfos { get; set; }

        /// <summary>
        /// 是否已经完成
        /// </summary>
        public bool IsDone
        {
            get { return (CacheInfos ?? new List<FileInfo>()).All(n => n.IsInLocal); }
        }
    }
}
